import request from '@/utils/request'

export default {
  getList: function () {
    return request({
      url: '/sysMenu/list',
      method: 'get'
    })
  },
  getMenuTree: function () {
    return request({
      url: '/sysMenu/getMenuTree',
      method: 'get'
    })
  },
  listForRouter: function (params) {
    return request({
      url: '/menu/listForRouter',
      method: 'get',
      params
    })
  },
  save: function (params) {
    return request({
      url: '/sysMenu/add',
      method: 'post',
      data: params
    })
  },
  delMenu: function (id) {
    return request({
      url: '/sysMenu/delete/'+id,
      method: 'get'
    })
  },
  menuTreeListByRoleId: function (roleId) {
    return request({
      url: '/sysMenu/getRoleMenuTree/'+roleId,
      method: 'get',
    })
  }
}
